﻿<%@ Page Language="C#" AutoEventWireup="true"  ValidateRequest="False" CodeBehind="ProductDetail.aspx.cs" Inherits="ZLCMS.Web.SystemManage.Basics.Shop.Product.ProductDetail" %>

<%@ Register TagPrefix= "ddt" TagName= "DropDownTreeControl" Src= "~/SystemManage/Control/ddt/DropDownTreeControl.ascx " %> 
<%@ Register src="~/SystemManage/Control/JFileControl.ascx" tagname="JFileControl" tagprefix="uc1" %>
<%@ Register src="~/SystemManage/Control/SinglePictureControl.ascx" tagname="SinglePictureControl" tagprefix="spc" %>


<form id="pageForm" method="post" runat="Server" class="pageForm required-validate"
    onsubmit="return validateCallback(this, navTabAjaxDone);" action="/SystemManage/Basics/Shop/Product/ProductDetail.aspx">

<div class="pageContent">
    <div class="pageFormContent" layoutH="56">
    	

		<h3 class="contentTitle">基本信息</h3>  
      <dl class="nowrap">
            <dt>商品名称：</dt>
            <dd>
                <asp:textbox runat="server" id="tb_name" Width="200px" class="required"></asp:textbox>（建议10个汉字以内）
            </dd>
        </dl>
        
		<dl class="nowrap">
            <dt>商品分类：</dt>
            <dd>
            <ddt:DropDownTreeControl id= "ddl_producttype" runat= "Server" DataFromUrl="/SystemManage/Control/ddt/TreeData_Category.aspx" Kind="shop"/></dd>
        </dl>
		<dl class="nowrap">
            <dt>商品代码：</dt>
            <dd>
                <asp:textbox runat="server" id="tb_productno" readonly="true"></asp:textbox>
            </dd>
        </dl>
		<dl class="nowrap">
            <dt>内部编码：</dt>
            <dd>
                <asp:textbox runat="server" id="tb_no2"></asp:textbox>
            </dd>
        </dl>

            <fieldset>
            <legend>分类搜索属性定制 : </legend>
            <div class="checklist" id="div_category_search_property">
                <asp:repeater runat="server" id="rpt_category_property" onitemdatabound="rpt_category_property_ItemDataBound">
                 <ItemTemplate>
                                <dl class="nowrap">
                                <dt><%# Eval("PropertyValue") %>：</dt>
                                <dd id="Dd2"   style="width:900px;" >
                                     <asp:repeater runat="server" id="rpt_category_property_item">
                                        <ItemTemplate>
                                           <label for="ckb_property_item_<%#Eval("Id") %>"><%#Eval("PropertyName")%><input id="ckb_property_item_<%#Eval("Id") %>" <%#item==null?"": IsSelect(Convert.ToInt32( Eval("Id"))) %> onclick="AddPropertyItem(this)" type="radio" name="property_<%# Eval("SearchPropertyId ")  %>" value="<%#Eval("Id")%>" /></label>
                                        </ItemTemplate>
                                        </asp:repeater>
                               </dd>
                            </dl>
                        </ItemTemplate>
                </asp:repeater>
            </div>
            <asp:hiddenfield runat="server" id="hid_property_item"></asp:hiddenfield>
        </fieldset>

         <dl class="nowrap">
            <dt>等级：</dt>
            <dd><%--<asp:TextBox ID="level" runat="server" class="number"></asp:TextBox>--%>
            <asp:dropdownlist runat="server" id="ddl_level" class="combox" width="150px"></asp:dropdownlist>
            </dd>
        </dl>
		<dl class="nowrap">
            <dt>简单描述：</dt>
            <dd>
                <asp:textbox runat="server" width="100%" id="tb_shortdesc" 
                    TextMode="MultiLine" ></asp:textbox>
            </dd>
        </dl>
        <dl  class="nowrap">
            <dt>上架时间：</dt>
            <dd>
                <asp:textbox runat="server" datefmt="yyyy-MM-dd HH:mm:ss" class="date"  id="startDate"></asp:textbox>
                <a class="inputDateButton" href="javascript:;">选择</a>
                <span class="info">购买开始时间（默认只用于显示）</span>
            </dd>
        </dl>
		<dl  class="nowrap">
            <dt>下架时间：</dt>
            <dd>
                <asp:textbox runat="server" datefmt="yyyy-MM-dd HH:mm:ss" class="date" id="endDate"></asp:textbox>
                <a class="inputDateButton" href="javascript:;">选择</a>
                <span class="info">购买结束时间（默认只用于显示）</span>
            </dd>
        </dl>
		<dl>
            <dt>市场价格：</dt>
            <dd>
                <asp:textbox runat="server" class="required number" id="tb_mprice">0</asp:textbox>&nbsp;元&nbsp;
            </dd>
        </dl>
		<dl>
            <dt>销售价格：</dt>
            <dd>
                <asp:textbox runat="server" class="required number" id="tb_sprice">0</asp:textbox>&nbsp;元&nbsp;（客户购买时的价格）
            </dd>
        </dl>
		<dl>
            <dt>库存数量：</dt>
            <dd>
                <asp:textbox runat="server" class="required digits" min="0" id="tb_storage">0</asp:textbox>
            </dd>
        </dl>
		<dl class="nowrap">
            <dt>商品大图：</dt>
            <dd>（支持JPG、PNG格式，较好的效果为200*200）</dd>
        </dl>
        <dl class="nowrap">
            <dt>&nbsp;</dt>
            <dd><spc:SinglePictureControl ID="fc_open" runat="server" ImageWidth="200" ImageHeight="200" FileCountLimit="1" FileFilters="*.jpg;*.jpeg;*.bmp;*.png;*.gif" FileDesc="图片"/></dd>
        </dl>
		<dl class="nowrap">
            <dt>商品多图：</dt>
            <dd>（支持JPG、PNG格式，较好的效果为200*200）</dd>
        </dl>
          <dl class="nowrap">
            <dt>&nbsp;</dt>
            <dd>
            <uc1:JFileControl id= "fc_relatedimgs" runat= "Server" MaxFiles="5" FileType="jpg|png|jpeg|gif" AllowDelete="true" Enable="true" IsShowHistory="true"/>
             </dd>
        </dl>
		<dl class="nowrap">
            <dt>商品介绍：</dt>
            <dd>
            <textarea class="editor" name="txtSummary" rows="30" cols="100" style="width:100%" id="txt_description" runat="Server"
                    uplinkurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=zip,rar,txt" uplinkext="zip,rar,txt"
                    upimgurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=jpg,jpeg,gif,png" upimgext="jpg,jpeg,gif,png"
                    upflashurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=swf" upflashext="swf"
                    upmediaurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=avi" upmediaext="avi">
            </textarea>
            </dd>
        </dl>
	   <dl class="nowrap">
                <dt>详细参数：</dt>
                <dd>
                    <textarea class="editor" name="txtParamContent" rows="10" cols="100" style="width: 100%"
                        id="txtParamContent" runat="Server" uplinkurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=zip,rar,txt"
                        uplinkext="zip,rar,txt" upimgurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=jpg,jpeg,gif,png"
                        upimgext="jpg,jpeg,gif,png" upflashurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=swf"
                        upflashext="swf" upmediaurl="/SystemManage/Common/ContentUpload.aspx?dir=doc&ext=avi"
                        upmediaext="avi">
            </textarea>
            </dd>
        </dl>
	</div>
        
    <div class="formBar">
    <input id="submit_op" name="submit_op" type="hidden" />
	    <ul>
          <% if (ZLCMS.Commands.User.Util.AuthUtil.CheckAuthorization("PRODUCT_MAN", "EDIT"))
             { %>
			<li>
	        <div class="buttonActive"><div class="buttonContent"><button onclick="$('#submit_op', navTab.getCurrentPanel()).val('0');" type="submit">保存</button></div></div>
            </li>
            <%} %>
          <% if (ZLCMS.Commands.User.Util.AuthUtil.CheckAuthorization("PRODUCT_MAN", "ADD"))
             { %>
			<li>
		    <div class="button"><div class="buttonContent">
		    <button type="button" onclick="navTab.openTab('ProductDetail', '/SystemManage/Basics/Shop/Product/ProductDetail.aspx?kind=<%=ViewState["kind"] %>',{data:{tabid:'ProductDetail'}});">取消并新增</button></div></div>
			</li>
            <li>
	        <div class="buttonActive"><div class="buttonContent"><button onclick="$('#submit_op', navTab.getCurrentPanel()).val('1');" type="submit">保存并新增</button></div></div>
            </li>
            <%} %>
			<li>
		    <div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div>
			</li>
		</ul>
    </div>
</div>
<script type="text/javascript">
    function AddPropertyItem(ct) {
        var propertyItems = [];
        $("#div_category_search_property").find("input[type=radio]:checked").each(function () {
            propertyItems.push($(this).val());
        });
        $("#hid_property_item").val(propertyItems);
    }
     <%if (item != null) {%>
    function ChangeCategoryId(ct) {
        $(ct).attr("href", '/SystemManage/Basics/ProductSKU/ModifyProductCategory.aspx?pno=<% =item.ProductNo %>&cid=' + $('#ddl_producttype_inpNodeValue').val())
}
<%}%>
</script>
</form>